﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZBJF.Warranty.Model;

namespace ZBJF.Warranty.IBLL
{
    public partial interface IInsuranceWarrantyRecordStatusService
    {
        /// <summary>
        /// 根据主键ID获取工单状态
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        InsuranceWarrantyRecordStatus LoadByID(int id);

        /// <summary>
        /// 根据状态获取工单状态
        /// </summary>
        /// <param name="status"></param>
        /// <returns></returns>
        InsuranceWarrantyRecordStatus LoadByStatus(byte status);
        /// <summary>
        /// 判断工单状态是否存在
        /// </summary>
        /// <param name="statusName">原因状态名称</param>
        /// <param name="id">工单状态ID</param>
        /// <returns></returns>
        bool IsExist(string statusName, int statusCode);
        /// <summary>
        /// 获取所有工单状态
        /// </summary>
        /// <returns></returns>
        IQueryable<InsuranceWarrantyRecordStatus> LoadAllEntity();
        /// <summary>
        /// 获取下级工单状态
        /// </summary>
        /// <param name="excludeCode">需要排除掉的状态值</param>
        /// <param name="parentId">父级ID</param>
        /// <returns></returns>
        IQueryable<InsuranceWarrantyRecordStatus> GetChildrenStatus(List<int> excludeCode, int parentId = 0);
        /// <summary>
        /// 获取下级工单状态
        /// </summary>
        /// <param name="parentCode">父级状态码Code</param>
        /// <param name="excludeCode">需要排除掉的状态值</param>
        /// <returns></returns>
        IQueryable<InsuranceWarrantyRecordStatus> GetChildrenStatus(byte parentCode, List<int> excludeCode);
        /// <summary>
        /// 获取当前状态码的状态名称
        /// </summary>
        /// <param name="status">状态码</param>
        /// <returns></returns>
        string GetStatusName(byte status);

        /// <summary>
        /// 获取上级状态码
        /// </summary>
        /// <param name="currentStatus">当前二级状态码</param>
        /// <returns></returns>
        byte GetParentStatusCode(byte currentStatus);
    }
}
